﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class DodajCrzest : Form
    {
        Form2 F;
        public DodajCrzest(Form2 F)
        {
            this.F = F;
            InitializeComponent();
        }

        private void DodajCrzest_Load(object sender, EventArgs e)
        {

        }

        private void OK_Click(object sender, EventArgs e)
        {
            string wyn = "insert into chrzty ( Rok, Numer, Id, data_chrztu, ojciec, matka, ojciec_chrzestny, matka_chrzestna, data_bierzmowania, miejsce_bierzmowania, uwagi, ks )";
            wyn += " values (";
            wyn += textBox1.Text + ", ";
            wyn += textBox2.Text + ", ";
            wyn += textBox3.Text + ", ";
            wyn +="\'"+ textBox4.Text + "\', ";
            wyn += textBox5.Text + ", ";
            wyn += textBox6.Text + ", ";
            wyn += textBox7.Text + ", ";
            wyn += textBox8.Text + ", ";
            wyn += "\'" + textBox9.Text + "\', ";
            wyn += "\'" + textBox10.Text + "\', ";
            wyn += "\'" + textBox11.Text + "\', ";
            wyn += textBox12.Text + " );";
            BazaDaych.Wykonaj(wyn);
            F.pokazwszystko();
            this.Close();
        }
    }
}
